/* ==========================================================================
   统一CSS样式库 - xyUser System
   ========================================================================== */

/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景装饰效果 */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: float 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.container-small {
    max-width: 700px;
    padding: 50px;
}

.container-medium {
    max-width: 900px;
    padding: 40px;
}

.container-large {
    max-width: 1200px;
    padding: 30px;
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 头部样式 */
.header {
    background: #f8f9fa;
    color: #333;
    padding: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* .header::before 样式已移除以提升性能 */

.header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

/* 内容区域 */
.content {
    padding: 50px;
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* 导航样式 */
.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
    margin: 20px 0;
    list-style: none;
}

.nav-pills .nav-link {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
    border-radius: 25px;
    padding: 12px 25px;
    margin: 0 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 2px solid rgba(255,255,255,0.2);
}

.nav-pills .nav-link:hover {
    background: rgba(255,255,255,0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.nav-pills .nav-link.active {
    background: rgba(255,255,255,0.3);
    color: white;
    font-weight: 600;
    border-color: rgba(255,255,255,0.4);
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
    color: white;
    text-decoration: none;
}

.btn:active {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
}

.btn-secondary:hover {
    box-shadow: 0 15px 30px rgba(108, 117, 125, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-danger:hover {
    box-shadow: 0 15px 30px rgba(220, 53, 69, 0.4);
}

.btn-small {
    padding: 8px 20px;
    font-size: 14px;
}

.btn-large {
    padding: 18px 40px;
    font-size: 18px;
}

/* 表单样式 */
.form-section {
    background: rgba(248, 249, 250, 0.8);
    backdrop-filter: blur(10px);
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 30px;
    border: 1px solid rgba(233, 236, 239, 0.5);
    animation: fadeInUp 0.8s ease-out;
}

.form-section h2 {
    color: #333;
    margin-bottom: 25px;
    font-size: 1.8rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 25px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.form-control, .form-select {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-control:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
    background: white;
    transform: translateY(-2px);
}

.form-control:hover, .form-select:hover {
    border-color: #b8c5f2;
    transform: translateY(-1px);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(233, 236, 239, 0.5);
    transition: all 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.card-body {
    color: #666;
    line-height: 1.6;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

/* 消息样式 */
.message {
    padding: 20px;
    border-radius: 15px;
    margin: 20px 0;
    font-weight: 500;
    animation: slideInDown 0.5s ease-out;
}

.success {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    border: 2px solid rgba(184, 218, 204, 0.5);
}

.error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    color: #721c24;
    border: 2px solid rgba(241, 176, 183, 0.5);
    animation: shake 0.5s ease-in-out;
}

.warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border: 2px solid rgba(255, 193, 7, 0.3);
}

.info {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    color: #0c5460;
    border: 2px solid rgba(23, 162, 184, 0.3);
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.table th,
.table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* 徽章样式 */
.badge {
    display: inline-block;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-radius: 20px;
    color: white;
}

.badge-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.badge-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.badge-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.badge-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #333;
}

.badge-info {
    background: linear-gradient(135deg, #17a2b8 0%, #6f42c1 100%);
}

/* 复选框和单选框样式 */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e1e5e9;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.checkbox-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 15px;
    }
    
    .header {
        padding: 25px 20px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .content {
        padding: 25px 20px;
    }
    
    .form-section {
        padding: 25px 20px;
    }
    
    .nav {
        flex-direction: column;
        align-items: center;
    }
    
    .nav-pills .nav-link {
        margin: 5px 0;
        width: 200px;
        text-align: center;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card {
        padding: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 25px 20px;
        width: 95%;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .content {
        padding: 20px 15px;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .nav-pills .nav-link {
        width: 100%;
        margin: 3px 0;
    }
    
    .card {
        padding: 15px;
    }
    
    .modal-content {
        padding: 20px 15px;
    }
}

/* 工具类 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }
.p-5 { padding: 3rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .header {
        background: #f8f9fa;
        color: #333;
    }
    
    .btn {
        display: none;
    }
}